//
// Created by FindBin on 2024/6/9.
//

#pragma once

#include "main.h"

/// do not alter
#define base_id (0x7a0)

enum {
    FunctionCode_byte,
    Action_byte,
    Member_byte,
};
typedef enum {
    OPEN_Action = 0xfb,
    CLOSE_Action = 0xbf,
} ActionCode;
typedef enum {
    RESET_RETRY = 0xa1,
    GET,
    TEST,
    ALL_OPEN,
    ALL_CLOSE,
    CONTROL
} FunctionCode;
typedef enum {
    c1 = 0,
    c2,
    c3,
    c4,
    c5,
    c6,
    c7,
    c8,
    c9,
    c10,
} MemberCode;

void slowStart_allopen(FDCAN_HandleTypeDef *hfdcan,uint8_t id);

void slowStart_allclose(FDCAN_HandleTypeDef *hfdcan,uint8_t id);

void slowStop_ctrl(FDCAN_HandleTypeDef *hfdcan,uint8_t id,uint8_t port_id,uint8_t state);